<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>学生管理首页</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/font-awesome.min.css">
    <link rel="stylesheet" href="css/AdminLTE.min.css">
    <link rel="stylesheet" href="css/_all-skins.min.css">
    <link rel="stylesheet" href="css/index.css">
    <link rel="stylesheet" href="css/dialog.css">
    <link rel="stylesheet" href="css/zpageNav.css"/>

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>

<body class="hold-transition skin-red  sidebar-mini">
<div class="wrapper" id="app">

    <!--顶部内容-->
    <header class="main-header">
        <a href="#" class="logo">
            <span class="logo-lg"><b>员工管理系统</b></span>
        </a>
        <nav class="navbar navbar-static-top" role="navigation">
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only">Toggle navigation</span>
            </a>
        </nav>
    </header>

    <!--侧边栏-->
    <aside class="main-sidebar">
        <ul class="sidebar-menu" data-widget="tree">
            <li class="header">辉哥真球帅</li>
            <li class="active"><a href="#"><i class="fa fa-link"></i> <span>学生管理</span></a></li>
        </ul>
    </aside>

    <!--中间部分-->
    <div class="content-wrapper">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <div class="form-group form-inline">
                            <div class="btn-group">
                                <button @click="add" type="button" class="btn  btn-danger" title="新建"
                                        data-toggle="modal"
                                        data-target="#editDialog">新建
                                </button>

                                <button type="button" class="btn  btn-danger" title="新建" data-toggle="modal"
                                        data-target="#ImportModal">导入
                                </button>

                                <button type="button" class="btn  btn-danger" title="新建" data-toggle="modal"
                                        data-target="#ExportModal">导出
                                </button>
                            </div>
                        </div>
                    </div>

                    <div class="box-body">
                        <table id="example2" class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>id</th>
                                <th>姓名</th>
                                <th>邮箱</th>
                                <th>手机号</th>
                                <th>工资</th>
                                <th>部门</th>
                                <th>地址</th>
                                <th>入职时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr v-for="(item,index) in employeeList" :key="index">
                                <td>{{item.employeeId}}</td>
                                <td>{{item.employeeName}}</td>
                                <td>{{item.employeeEmail}}</td>
                                <td>{{item.employeePhone}}</td>
                                <td>{{item.employeeSalary}}</td>
                                <td>{{item.employeeDept}}</td>
                                <td>{{item.employeeAddress}}</td>
                                <td>{{item.employeeTime}}</td>
                                <td>
                                    <button class="btn btn-sm  btn-info"
                                            data-toggle="modal"
                                            data-target="#editDialog"
                                            @click="show(item)">
                                        编辑
                                    </button>
                                    <button class="btn btn-sm  btn-warning"
                                            data-toggle="modal"
                                            data-target="#delModal"
                                            @click="employee.employeeId = item.employeeId"
                                    >
                                        删除
                                    </button>
                                </td>
                            </tr>

                            </tbody>

                        </table>

                        <div class="wrap">
                            <zpagenav v-bind:page="currentPage" v-bind:page-size="pageSize" v-bind:total="total"
                                      v-bind:max-page="maxPage" v-on:pagehandler="pageHandler">
                            </zpagenav>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>

    <!--删除弹框-->
    <div class="modal fade" id="delModal">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title">温馨提示</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    你确定要删除吗?
                </div>
                <div class="modal-footer ">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" @click="deleteEmployee" class="btn btn-success delSure" data-dismiss="modal">
                        确定
                    </button>
                </div>
            </div>
        </div>
    </div>

    <!-导入弹框-->
    <div class="modal fade" id="ImportModal">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title">文件导入</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class=" form-group row">
                        <div class="col-sm-10">
                            <label class="btn btn-primary"><input type="file"
                                                                  multiple
                                                                  style="display:none;"
                                                                  name="avater"
                                                                  @change="getForm"> 上传表格</label>
                        </div>
                    </div>
                </div>
                <div class="modal-footer ">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" @click="importElsx" class="btn btn-success delSure" data-dismiss="modal">确定
                    </button>
                </div>
            </div>
        </div>
    </div>

    <!--<!-导出弹框&ndash;&gt;-->
    <div class="modal fade" id="ExportModal">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title">温馨提示</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    你确定要导出吗?
                </div>
                <div class="modal-footer ">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <a type="button" href="http://localhost:8080/employee/export">确定
                    </a>
                </div>
            </div>
        </div>
    </div>

    <!--新建 编辑弹框-->
    <div class="modal fade" id="editDialog">
        <div class="modal-dialog modal-lg edit-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title">员工操作</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="card-body">
                        <div class="form-group row">
                            <label class="col-sm-2 col-form-label">员工姓名:</label>
                            <div class="col-sm-10">
                                <input type="text" v-model="employee.employeeName" class="form-control"
                                       placeholder="请输入员工姓名">
                            </div>
                        </div>
                        <div class=" form-group row">
                            <label class="col-sm-2 col-form-label">员工邮箱:</label>
                            <div class="col-sm-10">
                                <input type="text" v-model="employee.employeeEmail" class="form-control"
                                       placeholder="请输入员工邮箱"/>
                            </div>
                        </div>
                        <div class=" form-group row">
                            <label class="col-sm-2 col-form-label">员工手机:</label>
                            <div class="col-sm-10">
                                <input type="text" v-model="employee.employeePhone" class="form-control"
                                       placeholder="请输入员工手机"/>
                            </div>
                        </div>


                        <div class=" form-group row">
                            <label class="col-sm-2 col-form-label">员工工资:</label>
                            <div class="col-sm-10">
                                <input type="text" v-model="employee.employeeSalary" class="form-control"
                                       placeholder="请输入员工工资"/>
                            </div>
                        </div>

                        <div class=" form-group row">
                            <label class="col-sm-2 col-form-label">员工部门:</label>
                            <div class="col-sm-10">
                                <input type="text" v-model="employee.employeeDept" class="form-control"
                                       placeholder="请输入员工部门"/>
                            </div>
                        </div>

                        <div class=" form-group row">
                            <label class="col-sm-2 col-form-label">员工地址:</label>
                            <div class="col-sm-10">
                                <input type="text" v-model="employee.employeeAddress" class="form-control"
                                       placeholder="请输入员工地址"/>
                            </div>
                        </div>


                        <div class=" form-group row">
                            <label class="col-sm-2 col-form-label">入职时间:</label>
                            <div class="col-sm-10">
                                <input id="date" v-model="employee.employeeTime" type="date" class="form-control"/>
                            </div>
                        </div>
                        <div class=" form-group row">
                            <label class="col-sm-2 col-form-label">员工头像</label>
                            <div class="col-sm-10">
                                <label class="btn btn-primary"><input type="file"
                                                                      multiple
                                                                      style="display:none;"
                                                                      id="avater"
                                                                      @change="upload"> 上传图片</label>
                                <img :src="imageURL" alt="" width="100px" height="100px"
                                     style="border: 1px solid #ccc; margin-left: 100px">
                            </div>
                        </div>
                    </div>

                </div>
                <div class="modal-footer ">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" @click="addOrUpdate" class="btn btn-success" data-dismiss="modal">确定</button>
                </div>
            </div>
        </div>
    </div>

</div>


<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/vue.min.js"></script>
<script src="js/axios.min.js"></script>
<script src="js/adminlte.min.js"></script>
<script src="js/zpageNav.js"></script>
<script src="js/myaxios.js"></script>
<script src="js/index.js"></script>


</body>
</html>